@extends('layouts._app')
@section('content')
    <body>
    <div class="wrap-container">
        @include('layouts._flash')
        <div id="LAY-popup-user-add" class="layui-layer-content">
            <div class="layui-form" lay-filter="layuiadmin-form-role" style="padding: 20px 30px 0 0;">
                {!! Form::open(['route' => 'system.user.store','class'=>'layui-form','method'=>'post']) !!}
                {!! Form::hidden('submit','4') !!}
                {!! Form::hidden('filter','true') !!}
                <div class="layui-form-item">
                    {!! Form::label('','* 用户名：',['class'=>'layui-form-label','style'=>'color:red']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('name','',['required','lay-verify'=>'required','class'=>'layui-input','placeholder'=>'请输入名称']) !!}
                    </div>
                </div>

                <div class="layui-form-item">
                    {!! Form::label('','手机号：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('phone','',['class'=>'layui-input','placeholder'=>'请输入手机号']) !!}
                    </div>
                </div>

                <div class="layui-form-item">
                    {!! Form::label('','* 邮箱：',['class'=>'layui-form-label','style'=>'color:red']) !!}
                    <div class="layui-input-inline">
                        {!! Form::email('email','',['required','id'=>'email_4','lay-verify'=>'required','class'=>'layui-input','placeholder'=>'请输入邮箱号']) !!}
                    </div>
                    <a href="javascript:void(0);" onclick="captcha('0',4,'{{route('code')}}','{{ csrf_token() }}')"
                       id="code_de_4"
                       style="margin:10px;text-align: center">发送验证码</a>
                </div>
                <div class="layui-form-item" id="email_code_4" style="display: none;">
                    {!! Form::label('','* 邮箱验证码：',['class'=>'layui-form-label','style'=>'color:red']) !!}
                    <div class="layui-input-inline">
                        {!! Form::text('code','',['readonly','id'=>'code_4','class'=>'layui-input','placeholder'=>'无更改无需填写']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','密码：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::password('password',['class'=>'layui-input','placeholder'=>'密码可以不用填写,默认123456']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','用户组：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        @foreach($roles as $value)
                            <input type="checkbox" @if($value->name != '超级管理员') name="role_id[]" value="{{$value->id}}"
                                   @else disabled @endif
                                   lay-filter="owner_one" title="{{$value->name}}">
                        @endforeach
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('确认',['class'=>'layui-btn','lay-filter'=>'formDemo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
        </div>
    </div>
    <script src="{{asset('static/admin/layui/layui.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('static/admin/js/common.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/jquery.min.js')}}" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="{{asset('js/jquery.base64.js')}}"></script>
    <script type="text/javascript" src="{{asset('js/jquery.cookie.js')}}"></script>
    <script type="text/javascript" src="{{asset('js/common.js')}}"></script>
    <script>
        captchaInput(4);
        //Demo
        layui.use(['form', 'layer'], function () {
            var form = layui.form();
            form.render();

            //监听提交
            form.on('submit(formDemo)', function (data) {
            });
        })
    </script>
    </body>
@endsection
